//
//  WHIntroduceFishSpotVC.m
//  WHEasyBizLink
//
//  Created by ShengMeng on 9/26/25.
//

#import "WHIntroduceFishSpotVC.h"
#import "WHIntroduceFishSpotCell.h"
#import "WHIntroduceFishSpotModel.h"
#import "WHHeaderButtonView.h"
#import "WHFreedomFishModel.h"
#import "WHHeaderButtonModel.h"
#import "WHFishSpotModel.h"
#import "SearchTitleView.h"
#import "SDAutoLayout.h"
#import "WHTdsModel.h"
#import "MJRefresh.h"

#define pagesize 80

static NSString *const kCellID = @"WHIntroduceFishSpotVCCellID";

@interface WHIntroduceFishSpotVC ()<WHHeaderButtonViewDelegate>

@property (nonatomic,assign)CGFloat viewHeight;

@property (nonatomic,strong)NSMutableArray*models;

@end

@implementation WHIntroduceFishSpotVC

-(instancetype)initWithHeight:(CGFloat)viewHeight
{
    self = [super init];
    if (self)
    {   self.viewHeight = viewHeight;
        self.tableView.mj_footer =nil;
    }
    return self;
}

- (void)viewDidLoad {

    [super viewDidLoad];
}

#pragma mark - loadDatas
- (void)loadDatas{
    [super loadDatas];
    self.datas   = [WHIntroduceFishSpotModel getDatasModel];
    
}
#pragma mark - setupUI
- (void)setupUI{
    [super setupUI];
    self.title =@"钓场介绍";
    //一个简单的super setupUI = createTableView
    self.tableView.frame =CGRectMake(0,navHeight1,ScreenW,ScreenH-navHeight1);
}

-(void)rightBarButtonItemClicked
{

}
- (void)setViewFooterWithHave:(BOOL) have{
    if(have){
        self.tableView.mj_footer = [MJRefreshAutoNormalFooter footerWithRefreshingBlock:^{
        }];
    }else{
        self.tableView.mj_footer =nil;
    }
}

- (void)setViewFooterEndRefresh{
    [self.tableView.mj_footer endRefreshing];
}

#pragma mark - <tableViewDelegate>
- (UITableViewCell *)tableView:(UITableView *)tableView
         cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    WHIntroduceFishSpotCell *cell =[tableView dequeueReusableCellWithIdentifier:kCellID];
    if (!cell) {
        cell = [[WHIntroduceFishSpotCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:kCellID];
    }
    cell.model = self.datas[indexPath.row];
    return cell;
}

- (CGFloat)tableView:(UITableView *)tableView
 heightForRowAtIndexPath:(NSIndexPath *)indexPath{

    //return 200;
    
    return [tableView cellHeightForIndexPath:indexPath model:self.datas[indexPath.row] keyPath:@"model" cellClass:[WHIntroduceFishSpotCell class] contentViewWidth:ScreenW];
}

-(void)tableView:(UITableView *)tableView
commitEditingStyle:(UITableViewCellEditingStyle)editingStyle
forRowAtIndexPath:(NSIndexPath *)indexPath
{
   
}

-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{

}

@end
